var mongoose=require('mongoose');
var commentSchema=mongoose.Schema({
    book_id:{
        type:mongoose.Schema.ObjectId,
        ref:'Book'
    },
    sku:String,//book sku

    commentCount:Number,//总评论数
    commentCountStr:String,

    goodCount:Number,//好评数
    goodRate:Number,//好评率
    goodCountStr:String,

    generalCount:Number,//中评数
    generalRate:Number,//中评率
    generalCountStr:String,

    poorCount:Number,//中评数
    poorRate:Number,//中评率
    poorCountStr:String,

    comments:[
        {
            score:Number,//评分
            content:String,//内容
            time:Date,
            nick:String,
            images:[String],//原始数据
            smalls:[String],//小图片
            bigs:[String]//大图片
        }
    ]
});

module.exports=mongoose.model('Comment',commentSchema);